package com.outdoor.server.Task;

import com.outdoor.server.mapper.EventMapper;
import com.outdoor.server.service.EventService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
@Slf4j
public class EventTask {
    @Autowired
    private EventService eventService;

    @Scheduled(cron = "0 * * * * ?")//每分钟执行一次
    public void checkEventStatus() {
        log.info("活动状态检查开始");
        eventService.checkEventStatus();
    }

}
